import { elementMatchesRule } from './elementMatchesRule';

/**
 * @private
 */

export function getGlobalStylesForElement(element,cssRules = {}) {
  let styles = {};
  for (const rule in cssRules) {
    if (elementMatchesRule(element, rule.split(' '))) {
      styles = {
        ...styles,
        ...cssRules[rule],
      };
    }
  }
  return styles;
}
